Skip to main content

AWSS3GetObject

Type

command

Summary

Get an object

Syntax

AWSS3GetObject <pBucket>,<pObject>,<pParameters>,<pFile>,<pCallback>

Description

The caller of this command will be sent the callback message on completion with two parameters:

  • the request ID
  • the object data if the pFile parameter was empty.
  • an error message if one occurred
note

The message is sent before the tsNet connection is closed so it is possible to access the recieved headers using the tsNetRetrHeaders function

For futher details about this API see the AWS S3 REST API Documentation

Parameters

NameTypeDescription

pBucket

The name of a bucket

pObject

The name (key) of the object

pParameters

An array containing parameters to include in the request:

  • "response-content-type" (optional string): Sets the Content-Type header of the response.
  • "response-content-language" (optional string): Sets the Content-Language header of the response.
  • "response-expires" (optional string): Sets the Expires header of the response.
  • "response-cache-control" (optional string): ets the Cache-Control header of the response.
  • "response-content-disposition" (optional string): Sets the Content-Disposition header of the response.
  • "response-content-encoding" (optional string): Sets the Content-Encoding header of the response.

pFile

A file path to save the downloaded object directly to. Using this option will avoid having the entire object loaded into memory locally.

pCallback

A command name to be sent on completion with the server reponse.

Examples

AWSS3GetObject "mybucket", "myobject",  , "getObjectCallback"
put it into tRequestID

on getObjectCallback pRequestID, pResult, pError
if pError is empty then
put pResult into url "binfile:myfile.dat"
end if
end getObjectCallback

function: tsNetGetStatus, tsNetRetrHeaders

library: tsNet